using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;

namespace WebControls
{
   public class SFEmailBox: SFTextBox, IValidation, IReadOnly, IClear, ILabel
    {
        #region IValidation Members

       public override bool Validate()
       {
           if (!AllowNull && this.Visible)
           {
               if (!Validation.ValidateNotNull(this.Text))
               {
                   this.ErrorMessage += StaticMethods.GetErrorMessageMultilanguageString(22, new object[] { StaticMethods.GetErrorMessageControlName(this) });
               }
           }
           if (!this.HasErrors)
           {
               if (this.Visible)
               {
                   if (!(AllowNull && this.Text == ""))
                   {
                       if (!Validation.ValidateEmail(this.Text))
                       {
                           this.ErrorMessage += StaticMethods.GetErrorMessageMultilanguageString(18, new object[] { StaticMethods.GetErrorMessageControlName(this) });
                       }
                   }
               }
           }
           return this.HasErrors;
       }

        #endregion

   

   

      

       protected override void OnLoad(EventArgs e)
       {
           base.OnLoad(e);
       }
    }
}
